 class Solution {
public:
    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid)
    {
        vector<vector<int>> vv(obstacleGrid.size()+1,vector<int>(obstacleGrid[0].size()+1));
        vv[0][1] = 1;

        for(int i=1; i<vv.size(); i++)
        {
            for(int j=1; j<vv[0].size(); j++)
            {
                if(obstacleGrid[i-1][j-1] != 1)
                    vv[i][j] = vv[i-1][j] + vv[i][j-1];               
            }
        }

        return vv[obstacleGrid.size()][obstacleGrid[0].size()];
    }
};